<template>
  <div>
    <div style="text-align: center">
      <img class="head-banner" style="margin-bottom: 50px;">
    </div>
      <article-grid-view style="float: right" :list="resourcesList"/>
      <article-list-view style="margin-bottom: 30px" :list="noticeList"/>
      <teacher-display style="margin-bottom: 30px"/>


    <div style="display: flex;justify-content: space-between">
      <el-tabs v-model="activeName">
      <el-tab-pane :label="'学科动态'" :name="'1'">
        <article-list-view-with-time/>
      </el-tab-pane>
      <el-tab-pane :label="'学科教培'" :name="'2'">
        <article-list-view-with-time/>
      </el-tab-pane>
    </el-tabs>
      <div>
        <news-board/>
        <flb style="margin-top: 20px"/>
      </div>

    </div>



  </div>
</template>

<script>
import articleListView from '@/components/article-list-view'
import articleGridView from '@/components/article-grid-view'
import teacherDisplay from '@/components/teacher-display'
import ArticleListViewWithTime from '@/components/article-list-view-with-time'
import newsBoard from '@/components/news-board'
import flb from '@/components/friend-link-board'

//接口引入
import {getCategoryData} from '@/api/page'

export default {
  name: "category-view",
  components: {
    articleListView,
    articleGridView,
    teacherDisplay,
    ArticleListViewWithTime,
    newsBoard,
    flb
  },
  data() {
    return {
      activeName: '1',
        pageType:'',
        teacherList:[],   //教师风采列表
        resourcesList:[], //课程资源列表
        noticeList:[],    //学科通知列表
    }
  },
    created(){
      this.pageType = this.$route.query.type;
        this.getData()
    },
    watch:{
      $route(){
          this.pageType = this.$route.query.type;
          this.getData()
      }
    },
    methods:{
        /**
         * 获取数据
         */
        getData(){
            getCategoryData({type:this.pageType}).then(res =>{
                if(res.code == 200){
                    this.teacherList = res.data.jsfc;
                    this.resourcesList = res.data.kczy;
                    this.noticeList = res.data.xktz
                }
            })
      },
        /**
         * 跳转更多
         * @param type
         */
        toMore(type){
            let xl = type;
            if(!this.$utils.isEmpty(type)){
            }
        }
    }
}
</script>

<style lang="scss" src="./index.scss" scoped>


</style>
